package com.thanks.thinkchina.modules.controller;

import com.thanks.thinkchina.modules.service.ExchangeRateService;
import com.thanks.thinkchina.modules.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api("exchangerate modular")
@RequestMapping("/exchangerate")
@RestController
@RequiredArgsConstructor
public class ExchangeRateController {

    private final ExchangeRateService exchangeRateService;
    
    /***
     * @author yf.zhu
     * @description Get rate
     * @date 2022/6/23 10:44
     * @return com.thanks.foris.modules.util.R  
     */
    @ApiOperation(value = "Get annual bonus", notes = "Get annual bonus")
    @GetMapping("/rate" )
    public R rate(@RequestParam String target, @RequestParam String symbols) {
        log.info("ExchangeRateController rate method Parameter input target:{},symbols:{} ",target,symbols);
        return R.ok(this.exchangeRateService.rate(target, symbols));
    }


}
